<template>
  <div class="apap">
    <van-nav-bar title="添加新地址" @click-left="back" left-arrow />
    <van-address-edit
      :area-list="areaList"
      show-set-default
      :search-result="searchResult"
      :area-columns-placeholder="['请选择', '请选择', '请选择']"
      @save = "save"
    />
    <div class="bottom" @click="ss"></div>
  </div>
</template>

<script>
import areaList from '../assets/area'
export default {
  data () {
    return {
      areaList,
      searchResult: [],
      ad: []
    }
  },
  methods: {
    //   返回上一级
    back () {
      this.$router.go(-1)// 返回上一层
    },
    ss () {
    },
    save (center) {
      // console.log(sessionStorage.getItem('userid'))
      this.$http.post('/addres', { center: center, user_id: sessionStorage.getItem('userid') }).then(res => {
        if (res.data.ok === 1) {
          this.$router.push('/address')
        }
      })
    }
  },
  created () {
  }
}
</script>

<style scoped>
.van-nav-bar .van-icon {
  color: #333;
  font-size: 25px;
}
body {
  background-color: #f6f6f6;
}
.bottom {
  position: fixed;
  bottom: 0px;
  width: 100%;
  height: 50px;
  z-index: 999;
  background-color: #f6f6f6;
}
.van-button--danger{
  /* background: linear-gradient(90deg,#fa1e8c,#fc1e56) !important; */
  background-color: #000;

}
</style>
